source(here::here("code/load.R"))

# NOTE: the selow and sehigh do not seem to make sense. e.g for study 8 with
# estimate 1221, the "interval" doesn't contain the estimate, and this is
# typical

ids <- read_csv("study_id_num, study_id
1, Ashenfelter (1978)
2, Cooley (1979)
3, Kiefer (1979)
4, Kiefer (1978)
5, Gay and Borus (1978)
6, Bloom (1984)
7, Dickinson and West (1983)
8, Hollister et al. (1984)
9, Westat (1984)
10, Bassi (1983)
11, Bassi (1984)
12, Dickinson et al. (1986)
13, Dickinson et al. (1987)
14, Bryant and Rupp (1987)
15, Bloom (1987b)
16, Finifter (1987)
17, Ashenfelter and Card (1985)
18, Gay and Borus (1980)
19, Orr et al. (1996)
20, Long and Wissoker (1993)
21, Couch (1992)
22, Hollister et al. (1984)
23, Nightingale et al. (1991)
24, Bell and Orr (1994)
25, Freedman et al. (1988)
26, Auspos et al. (1988)
27, Burghardt et al. (1992)
28, Long et al. (1994)
29, Leigh (1995)
30, Dickinson et al. (1984)
31, Cain (1968)
32, Mallar et al. (1982)
33, Cave et al. (1993)
34, Quint et al. (1994)
35, Zambrowski and Gordon (1993)
36, Schochet et al. (2000)")

here("data/meta_analyses_raw/GreMicRob2006/Exp-Nonexp.csv") |>
    read_csv() |>
    mutate(meta_id = "GreMicRob2006",
           question = "Do Experimental and Nonexperimental Evaluations Give Different Answers about the Effectiveness of Government-Funded Training Programs?",
           subfield = "PA",
           overall_effect = "both") |>
    select(meta_id,
           subfield,
           study_id_num = study,
           sample_size = sampsize,
           estimate = impact99,
           std.error = seimp99,
           subset = exper,
           question,
           overall_effect) |>
    left_join(ids, by = "study_id_num") |>
    select(-study_id_num) |>
    write_csv(here("data/meta_analyses_clean/GreMicRob2006.csv"))
